<!DOCTYPE html>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@include file="/WEB-INF/view/common/common.jsp"%>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport"
          content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="${keywords}">
    <meta http-equiv="description" content="">
    <%@include file="/WEB-INF/view/common/head_css.jsp"%>
    <%@include file="/WEB-INF/view/common/head_css_startbootstrap.jsp"%>
    <%@include file="/WEB-INF/view/common/head_css_upload.jsp"%>
    <%@include file="/WEB-INF/view/common/head_css_fav.jsp"%>
    <title>提现记录</title>
</head>
<body>
<div id="wrapper">
    <jsp:include page="/menu.html"></jsp:include>
    <div id="page-wrapper">
        <nav class="navbar navbar-default" role="navigation">
            <div class="container-fluid">
                <div class="collapse navbar-collapse" id="top-navbar-collapse">
                    <form class="navbar-form navbar-left" id="searchForm"
                          role="search" action="<c:url value='/cash/index.html'/>"
                          method="GET">
                        <div class="form-group">
                            <label class="">用户名</label>
                            <input type="text" value="${parameter.entity.user.realName}" name="entity.realName" id="realName"
                                   autofocus class="typeahead form-control" placeholder="用户名">
                            <label class="">电话</label>
                            <input type="text" value="${parameter.entity.user.mobile}" name="entity.mobile" id="mobile"
                                   autofocus class="typeahead form-control" placeholder="电话">
                            <label class="">银行名称</label>
                            <input type="text" value="${parameter.entity.bankName}" name="entity.bankName" id="bankName"
                                   autofocus class="typeahead form-control" placeholder="银行名称">
                            <label class="">卡号</label>
                            <input type="text" value="${parameter.entity.cardNumber}" name="entity.cardNumber" id="cardNumber"
                                   autofocus class="typeahead form-control" placeholder="卡号">
                            <button type="submit" class="btn btn-primary" id="search"
                                    name="search">
                                <span class="glyphicon glyphicon-search searchBtn"></span>&nbsp;查询
                            </button>
                        </div>
                    </form>
                </div>
            </div>
        </nav>
        <div class="row" style="margin-top: 10px">
            <div class="col-lg-12 col-md-12">
                <div class="table-responsive">
                    <table
                            class="table table-striped table-bordered table-hover table-condensed">
                        <thead>
                        <tr>
                            <%--<th>选择</th>--%>
                            <th>用户名</th>
                            <th>手机号</th>
                            <th>卡号</th>
                            <th>银行名称</th>
                            <th>提现金额</th>
                            <th>扣除手续费</th>
                            <th>兑换代金券</th>
                            <th>实时到账</th>
                            <th>申请时间</th>
                            <th>状态</th>
                            <th>操作人/处理人</th>
                            <th>处理时间</th>
                            <th>未通过原因</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody id="dataList">
                        <c:forEach items="${list}" var="g">
                            <tr data-row="${g.id}">
                                <%--<td><input type="checkbox" value="${g.id}"></td>--%>
                                <td>${g.user.realName}</td>
                                <td>${g.user.mobile}</td>
                                <td>${g.cardNumber}</td>
                                <td>${g.bankName}</td>
                                <td>${g.amountMoney}</td>
                                <td>${g.poundage}</td>
                                <td>${g.voucher}</td>
                                <td>${g.money}</td>
                                <td>${g.createTime}</td>
                                <c:if test="${g.status == 0}">
                                    <td style="color: red">审核中</td>
                                </c:if>
                                <c:if test="${g.status == 1}">
                                    <td style="color: #1AA818">已通过</td>
                                </c:if>
                                <c:if test="${g.status == 2}">
                                    <td style="color: #2a6496">未通过</td>
                                </c:if>
                                <td>${g.name}</td>
                                <td>${g.handleTime}</td>
                                <td>${g.reason}</td>
                                    <td>
                                        <c:if test="${g.status != 1 && g.status != 2}">
                                        <a class="btn btn-success default editBtn"
                                       href="<c:url value='/cash/edit.html?id=${g.id}' /> "><span
                                            class="glyphicon glyphicon-wrench" aria-hidden="true"></span>审核</a>
                                        </c:if>
                                    </td>

                                        <%--&lt;%&ndash;<a class="ajaxLink btn btn-danger default" data-role="delete"&ndash;%&gt;--%>
                                       <%--&lt;%&ndash;href="<c:url value='/prize/remove.json?id=${g.prizeId}' /> "><span class="glyphicon glyphicon-remove" aria-hidden="true"></span>删除</a>&ndash;%&gt;--%>
                                <%--</td>--%>
                            </tr>
                        </c:forEach>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-md-12 col-sm-12 col-xs-12">
                <jsp:include page="/WEB-INF/view/common/pager.jsp"></jsp:include>
            </div>
        </div>
    </div>
</div>

</div>
<jsp:include page="/WEB-INF/view/common/head.jsp"></jsp:include>
<jsp:include page="/WEB-INF/view/common/startbootstrap.jsp"></jsp:include>
<jsp:include page="/WEB-INF/view/common/script_upload.jsp"></jsp:include>
<jsp:include page="/WEB-INF/view/common/script_common.jsp"></jsp:include>

<script type="text/javascript">
    $(function() {
        $(".addBtn").click(
            function(e) {
                e.preventDefault();
                e.stopPropagation();
                $("#myModal").load(
                    "<c:url value='/prize/edit.html'/>",
                    function(e) {
                        $('#myModal').modal({
                            backdrop : "static"
                        });
                    });
            });
        // $(".editBtn").click(function(e){
        //     e.preventDefault();
        //     e.stopPropagation();
        //     $("#myModal").load($(this).attr("href"),function(e) {
        //         $('#myModal').modal({
        //             backdrop : "static"
        //         });
        //     });
        // });
        $("#dataList a.ajaxLink").click(function(e){
            e.preventDefault();
            e.stopPropagation();
            var method="POST";
            if($(this).attr("data-role")){
                if(!window.confirm("删除后无法恢复数据,是否继续删除?")){
                    return false;
                }
                method="DELETE";
            }
            var url=$(this).attr("href");
            $.ajax({url:url,method:method,complete:function(xhr,ts){
                    if(xhr.status>=200 && xhr.status<300){
                        window.setTimeout(function() {
                            $("#search").click();
                        }, 1500);
                        $("#winBody").empty().html("操作成功");
                        $("#winModal").modal({backdrop:"static",show:true});
                    }else{
                        $("#winBody").empty().html("操作失败").addClass("text-danger");
                        $("#winModal").modal({backdrop:"static",show:true});
                    }
                }});
            location.reload();
        });
        $("tbody tr[data-row]").each(function(index,row){
            $(row).click(function(event){
                if(event.target.nodeName!="INPUT"){
                    rowSelect($(this));
                }
                switchCss($(this));
            });
            $(row).bind("contextmenu",function(){
                return false;
            });
        });
    });
</script>
</body>
</html>
